/**
 * 
 */
package com.bitrate.dagger.server.im.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.bitrate.dagger.restful.response.ResponseResult;
import com.bitrate.dagger.server.im.entity.tdengine.ChatRecord;
import com.bitrate.dagger.server.im.mapper.tdengine.ChatRecordMapper;

import cn.hutool.core.date.DateUtil;

/**
 * @version v1.0
 * @author 刘小龙
 * @date 2024年1月19日上午10:59:33
 */
@RequestMapping("/chat-api")
@RestController
public class ApiChatController {

	@Autowired
	private ChatRecordMapper chatRecordMapper;

	@GetMapping("/send")
	public ResponseResult<String> send() {
		ChatRecord chatRecord = new ChatRecord();
		chatRecord.setFromId(1001);
		chatRecord.setToId(2001);
		chatRecord.setMessage("在么?");
		chatRecord.setCreateTime(DateUtil.dateSecond().toTimestamp());
		chatRecordMapper.insert(chatRecord);
		return ResponseResult.successNotice("发送成功");
	}

}
